//
//  UITextField.swift
//  CMKit
//
//  Created by travel on 2016/12/16.
//  Copyright © 2016年 covermedia. All rights reserved.
//

import UIKit


public extension UITextField {
    
    /// 设置文字左边距
    ///
    /// - Parameter margin: 边距像素
    public func setTextLeftMargin(_ margin:CGFloat = 12) {
        leftViewMode = .always
        leftView = UIImageView.init(image: UIImage.imageWith(color: UIColor.clear, size: CGSize.init(width: margin, height: 1)))
    }
}
